//
//  SelectGoldCell.swift
//  Box
//
//  Created by mn on 2025/4/4.
//
import UIKit
class SelectGoldCell: UICollectionViewCell {
    
    let priceLabel: UILabel = {
        let label = UILabel()
        label.textColor = .fromHex("#7A8D8B")
        label.textAlignment = .center
        label.font = UIFont.systemFont(ofSize: 13,weight: .medium)
        return label
    }()
    let goldLabel: UILabel = {
        let label = UILabel()
        label.textColor = .fromHex("#1B3B49")
        label.font = UIFont.systemFont(ofSize: 20,weight: .bold)
        return label
    }()
    private let goldIcon: UIImageView = {
        let imageView = UIImageView(image: UIImage.gold)
        imageView.contentMode = .scaleAspectFit
        return imageView
    }()
    override init(frame: CGRect) {
        super.init(frame: frame)
        setupView()
    }
    
    required init?(coder: NSCoder) {
        super.init(coder: coder)
        setupView()
    }
    
    private func setupView() {
        contentView.addSubview(priceLabel)
        let view = UIView()
        view.addSubview(goldIcon)
        view.addSubview(goldLabel)
        contentView.addSubview(view)
        view.snp.makeConstraints { make in
            make.top.equalToSuperview().offset(15)
            make.centerX.equalToSuperview()
            make.height.equalTo(23)
        }
        goldIcon.snp.makeConstraints { make in
            make.left.equalToSuperview()
            make.size.equalTo(CGSize(width: 23, height: 23))
        }
        goldLabel.snp.makeConstraints { make in
            make.left.equalTo(goldIcon.snp.right).offset(3)
            make.right.equalToSuperview()
        }

        priceLabel.snp.makeConstraints { make in
            make.bottom.equalToSuperview().offset(-13)
            make.centerX.equalToSuperview()
        }
        contentView.backgroundColor = .fromHex("#F4F6F8")
        contentView.layer.cornerRadius = 18
        contentView.layer.masksToBounds = true
        contentView.layer.borderWidth = 2

    }
}
